#include "stm32f10x.h"
#include "pwm.h"
#include "pwmi.h"
#include "oled.h"
#include "delay.h"

int main(void)
{
    OLED_Init();
    PWM_Init();
    PWMI_Init();

    OLED_ShowString(1, 1, "Freq:00000Hz");
    OLED_ShowString(2, 1, "Duty:00%");
    PWM_SetPrescaler(720 - 1);  //Freq = 72M / (PSC + 1) / 100
    PWM_SetCompare(50);         //Duty = CCR / 100

    while (1)
    {
        OLED_ShowNum(1, 6, PWMI_GetFreq(), 5);
        OLED_ShowNum(2, 6, PWMI_GetDuty(), 2);
    }
}
